Program §Cradle                             ~ Program decl.: the `` comment
                                            ~ right after stands for
                                            ~ Documentation would also have been
                                            ~ 'Package' or 'Sub $... : §Cradle'
`This program stands for looking what I want cradle language to comme in terms
of syntax and more... It isn't exhaustive as somme functionnalities are not used
in (eg. for, switch and while, for instance)`
§_.@IsMain : @HiWorld                       ~ Decides that main func is @HiWorld
                                            ~ Defaults stands for @Main. 

Use §GrUi                                   ~ This makes the compiler look for
                                            ~ undefined topics in the grui pack.
`We will use graphical ui`                  ~ We would, else, declare all topics
                                            ~ in grui pack. by calling grui::...

Procedure &TestProc : $2                    ~ Declare a procedure wich takes two
                                            ~ arguments of type $ (one unit var)
`This proc calcules $1 * $2 and print it on the console.`
    §IO::@PrintLn : $1 * $2                 ~ No bloc needed for one line proc
                                            ~ but indent is
    
Function @Error : $$ => $2                  ~ Declares a fonction that takes a
                                            ~ variable number of arguments and
                                            ~ return only one.
`We result in printing a line in STDERR by argument, and returning the number
of args`
{                                           ~ A code block can be defined by {}
    §IO::@Println : "Error : $%" :          ~ Can switch line in this case.
                                            ~ Indent is good !.
        §IO::<>STDERR                       ~ Here is needed more explanation:
                                            ~ $% stands for repeating the code
                                            ~ line untill the end of args,
                                            ~ each time with the next one.
                                            ~ Moreover, args of a function are
                                            ~ given by ':'
    @Error <= $#2
}

Function @Fact : $N => $1
{
    If $_ < 0
        @Error <= "@Fact" : $#              ~ $# stands here for $1 or $N or $_
                                            ~ If there had been many args, it
                                            ~ would've stand for $1 : $2 : .. $n
    Else If $1 == 1 || $1 == 0
        @Fact <= 1
        Break                               ~ Assigning a value to an object
    
    {                                       ~ don't stops its execution
        @Fact <= $1 * @Fact : 
            ( $1 - 1 )                      ~ () for clarifying priority order
    }
}

Class <>TestClass : NIL                     ~ This class decl. stands for a
                                            ~ class that takes no args 
                                            ~ (inherits nothing). Would have
                                            ~ been written 'Class <>TestClass'
`Some kind of a class`
{
    <>_ : \\                                ~ Takes arrays in args.
    `Constructor`
    {                                       ~ There can be blocks everywhere
        ~ blablabla
    }
    
    ><_ => $1                               ~ Stands for >< => NIL : $1
    `Destructor`
    {
        ~ blablabla
        >< <= 0                             ~ When destructed, a new var. of
                                            ~ value '0' will be returned
    }
    
    Var $AVar
    Bool ^ABool
    Array \AnArray
    Dictionnary \/ ADictionnary
    List µAList <= 1 : (2 <= 3 : "Hel" <= "l") : "Hello World\n" : """Hello 
        World"""                            ~ """ string taken as <pre> text
    
    Procedure &TestProc : NIL               ~ A proc with 0 args. Would've been
                                            ~ 'Procedure &TestProc'
    {
        ~ blablabla
    }
    
    Function @DoThat : \\ : $2 => µ1 : $1
    {
        µAList.&Append : $2                ~ The second $ Arg
        If \% == $1                        ~ Here $1 stands for the arg.
            µAList.&Append : \_            ~ \_ stands for current (or the 
                                           ~ first if \% is not used
        Else If     ~ blablabla
    } __dothat0__                           ~ The asm name of the object
    
    Test _IsN
    {
        ~ This kind of function must return 'True' or 'False'
        _IsN <= True
    }
}

Function @HiWorld : $3 <= $1               ~ While this is the main func, the
                                           ~ return value must be $1 or NIL
                                           ~ following the OS' rules. Here the
                                           ~ program takes only 3 args
{
    Array \ArO <=   ~ blablabla __ar0__
    
    __ASM__                                ~ Assembly can be included
        pop
        
    __C__                                  ~ C as well, but be aware that only
                                           ~ pointers are passed
    {
        &dothat0(ar0, $1, $2);
        printf ("Hello World!");
    }    
        
    ~ blablabla
}

